/** Copyright (c) 2015—2017 Zerone.Co.Ltd. All rights reserved. */
package com.zerone.pay.merchant.repository.dao;

import com.acooly.module.jpa.EntityJpaDao;
import com.zerone.pay.merchant.repository.entity.MerchantEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/** @author glassescat <a href="">零一零一科技</a> */
public interface MerchantDao extends EntityJpaDao<MerchantEntity, Long> {

  @Query(value = "select t.* from merchant t where t.merchant_id = :merchantId ", nativeQuery = true)
  MerchantEntity findByMerchantId(@Param("merchantId")String merchantId);

  @Query(value = "select t.* from merchant t where t.mobile = :mobile OR t.email = :email", nativeQuery = true)
  MerchantEntity findByEmailOrMobile(@Param("email")String email, @Param("mobile") String mobile);
}
